package com.ycg.vue.modules.system.mapper;

import com.ycg.vue.modules.system.Dto.MaterialLibraryDto;
import com.ycg.vue.modules.system.Entity.MaterialLibraryEntity;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

/**
 * @Description
 * @Author jink
 * @Date 2024/6/19
 */
@Mapper
public interface MaterialLibraryMapper {

    void insert(@Param("m") MaterialLibraryEntity m);

    List<Map<String,Object>> list(@Param("dto") MaterialLibraryDto dto);

    @Select("SELECT * FROM material_library WHERE id = #{id}")
    MaterialLibraryEntity getById(@Param("id") String id);

    @Update("UPDATE material_library SET status = #{dto.status} WHERE id = #{dto.id}")
    void updateStatusById(@Param("dto") MaterialLibraryDto dto );

    @Delete("DELETE FROM material_library WHERE id = #{id}")
    void deleteById(@Param("id") String id);
}
